--StartUI.lua
require 'fairygui.Window'
StartUI = class(Window)

local VERSION = "1.0.2.2"

function StartUI:__init()
    self:loadLayout("StartUI", "Main")
    self:setChildUrl("image", "Image/1")
end

function StartUI:initEvent()
    -- 设置版本号
    self:getChild("EditorVersion").text = VERSION
    self:addClick("open", function()
        self:openGUI("MainUI", true)
    end)
    self:addClick("local", function()
        local panel = self:openGUI("BrowseUI", true)
        panel:initLocalUI()
    end)
    self:addClick("remote", function()
        self:openGUI("RemoteUI")
    end)

    self:addClick("archiveDir", function()
        local cmd = 'explorer /n,"' ..g_world_mgr.game_db_path..'"'
        cmd = cmd:gsub("/", "\\")
        io.popen(cmd, 'r')
    end)
    self:addClick("logDir", function()
        local cmd = 'explorer /n,"' ..g_world_mgr.game_log_path..'"'
        cmd = cmd:gsub("/", "\\")
        io.popen(cmd, 'r')
    end)
end

function StartUI:initComponent()
end

function StartUI:openRemoteUI()
    self:openGUI("RemoteUI")
end

function StartUI:onClose()
end